const initalState = {
    count:10
}

export function counterReducer(state = initalState,action){
    switch(action.type){
        case 'plus':
            state.count++
            return {
                count:state.count
            };
        case 'minus':
            state.count === 0 ? state.count = 0 : state.count--
            return {
                count:state.count
            };
        default:
            return state
    }
}